//
//  MHTable+Update.m
//  数据库的读写封装
//
//  Created by zsgjs on 2017/2/21.
//  Copyright © 2017年 zsgjs. All rights reserved.
//

#import "MHTable+Update.h"

@implementation MHTable (Update)

#pragma mark - update
- (void)updateFields:(NSDictionary *)fields andWhere:(NSString *)where
{
    [self.db clean];
    [self.db setCurrentTableName:self.tableName];
    [self.db whereWithString:where];
    [self.db updateWithData:fields];
}

- (void)updateField:(NSString *)field
           andValue:(id)value
           andWhere:(NSString *)where
{
    [self updateFields:@{field:value} andWhere:where];
}

@end
